const axios = require('axios')
const { map_key } = require('../uteil')

module.exports = async (req, res, next) => {
    console.log('收到的信息:', req.body);
    //拿到用户的位置
    let location = req.body

    for(value in location ){
    	location = JSON.parse(value)
    }

    axios.get(`https://apis.map.qq.com/ws/geocoder/v1/?location=${location.latitude},${location.longitude}&key=${map_key}&get_poi=1`).then(response => {
        console.log('逆解析后的结果', response.data);
        let { data } = response
        res.json({ data })
    })



}